<!doctype html>
<html>
<head>
<?php include('common_head.php'); ?>
</head>
<body>
<div class="wrap">
	<div class="nav">
		<ul class="cc">
			<li class="current"><a href="<?php echo site_url('admin/agency/index'); ?>">中介管理</a></li>
		</ul>
	</div>
	<div class="h_a">搜索</div>
	<div class="search_type cc mb10">
		<form action="<?php echo site_url('admin/agency/index'); ?>" method="get" accept-charset="utf-8">
			<label>中介名称：</label>
			<input name="name" type="text" class="input length_3 mr10" value="<?php echo $get['name']; ?>" />
			<label>管理帐号：</label>
			<input name="adminname" type="text" class="input length_2 mr10" value="<?php echo $get['adminname']; ?>" />
			<button type="submit" class="btn mr10">搜索</button>
		</form>
	</div>
	<div class="table_list">
		<table width="100%">
			<colgroup>
				<col width="50" />
				<col width="50" />
				<col width="220" />
				<col width="150" />
				<col width="250" />
				<col width="80" />
				<col width="50" />
			</colgroup>
			<thead>
				<tr>
					<td>ID</td>
					<td>排序</td>
					<td>中介名称</td>
					<td>电话</td>
					<td>地址</td>
					<td>管理员</td>
					<td>状态</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody>
			<?php
				foreach($agencys as $agency) {
					$agency['isopen'] == '1' && $isopen = '<span class="green">开启</span>';
					$agency['isopen'] == '0' && $isopen = '<span class="red">关闭</span>';
			?>
				<tr>
					<td><?php echo $agency['agencyid']; ?></td>
					<td><input type="text" name="vieworder[]" value="<?php echo $agency['vieworder']; ?>" class="input length_0" /></td>
					<td><?php echo $agency['name']; ?></td>
					<td><?php echo $agency['telphone']; ?></td>
					<td><?php echo $agency['address']; ?></td>
					<td><?php echo $agency['adminname']; ?></td>
					<td><?php echo $isopen; ?></td>
					<td>
						<a href="<?php echo site_url('admin/agency/edit?action=base&agencyid='.$agency['agencyid']); ?>" class="mr10" title="编辑基本信息">[基本]</a>
						<a href="<?php echo site_url('admin/agency/edit?action=data&agencyid='.$agency['agencyid']); ?>" class="mr10" title="编辑数据信息">[数据]</a>
						<a href="<?php echo site_url('admin/agency/edit?action=right&agencyid='.$agency['agencyid']); ?>" class="mr10" title="编辑权限信息">[权限]</a>
					<?php if($agency['isopen'] == 1) { ?>
						<a class="J_ajax_del" data-msg="确定要关闭吗？" href="<?php echo site_url('admin/agency/change_isopen?isopen=close&agencyid='.$agency['agencyid']); ?>" title="关闭">[关闭]</a>
					<?php } elseif ($agency['isopen'] == 0) { ?>
						<a class="J_ajax_del" data-msg="确定要开启吗？" href="<?php echo site_url('admin/agency/change_isopen?isopen=open&agencyid='.$agency['agencyid']); ?>" title="开启">[开启]</a>
					<?php } ?>
					</td>
				</tr>
			<?php } ?>
			</tbody>
		</table>
		<div data-key="true" class="J_page_wrap mb20">
			<?php echo $this->pagination->create_links(); ?>
		</div>
	</div>
</div>
<?php include('common_footer.php'); ?>
</body>
</html>